package com.yd.domain.commom;

import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;

public class DomainObject<T extends DomainObject<T>> implements Externalizable {

	/* protected void apply(Object event) {
		 EventBusManager.getEventBus().post(event).now();
	}*/
	
	private String id;
	private int pageIndex;
	private int pageSize;
	public DomainObject() {
		this.id = ObjectId.get().toStringMongod();
	}

	public void writeExternal(ObjectOutput out) throws IOException {
		//PersistenceHelper.write(out, this);
		out.writeObject(id);
	}

	public void readExternal(ObjectInput in) throws IOException,
			ClassNotFoundException {
		//PersistenceHelper.read(in, this);
		id = (String) in.readObject();
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

}
